import requests
import json

url = "https://api.github.com/user"
header = {
    "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36"
}
response = requests.get(url, headers=header)

#str
# data = response.content.decode('utf-8')
# #str-dict
# data_dict = json.loads(data)

data = response.json()

print(data['message'])
print(data)
print(type(data)) #<class 'dict'> 自动转换成dict
